//---------------------------------------------------------------------------
#pragma hdrstop
#include "classeFilaStl.h"
using namespace std;
//---------------------------------------------------------------------------
FilaStl::FilaStl()
{
	ptrFilaStl = new queue<String>;
}
//---------------------------------------------------------------------------
FilaStl::~FilaStl()
{
	delete ptrFilaStl;
	ptrFilaStl = NULL;
}
//---------------------------------------------------------------------------
void FilaStl::insere(String n)
{
	ptrFilaStl->push(n);
}
//---------------------------------------------------------------------------
String FilaStl::consulta()
{
	ptrFilaStl->front();
}
//---------------------------------------------------------------------------
void FilaStl::remove()
{
	ptrFilaStl->pop();
}
//---------------------------------------------------------------------------
void FilaStl::limpar()
{
	while (ptrFilaStl->size() > 0)
	{
		ptrFilaStl->pop();
    }
}
//---------------------------------------------------------------------------
int FilaStl::getTamanho()
{
	return ptrFilaStl->size();
}
//---------------------------------------------------------------------------
void FilaStl::listar(TStrings *itens)
{
	list<String> * lista = new list<String>;
	itens->Clear();

	while (ptrFilaStl->size() > 0)
	{
		lista->push_back(ptrFilaStl->front());
		ptrFilaStl->pop();
	}

	if (lista->size() > 0)
	{
		list<String>::iterator iteratorAux;
		iteratorAux = lista->begin();
		itens->Clear();

		while (iteratorAux != lista->end())
		{
			itens->Append(*iteratorAux);
			iteratorAux++;
		}
		
		iteratorAux = lista->begin();

		while (iteratorAux != lista->end())
		{
			ptrFilaStl->push(*iteratorAux);
			iteratorAux++;
		}
	}

	delete lista;
	lista = NULL;		
}
//---------------------------------------------------------------------------

#pragma package(smart_init)
